< previous page page_396 next page >

Page 396
contact at a time. This can be very inconvenient if you are working on an order for one customer and another telephones to discuss a new service. In this case, you have to close the client information for the current customer and open the information for the second customer. Wouldn't it be great if you could just open the information for the second customer in a new window? Well, with an MDI contact manager, you can.
This section shows you how to build a very simple MDI contact manager. The program displays only name and address information for a client and is basically an illustration of the concept. To create a full-fledged contact manager, you have to add additional database code. The program uses a Microsoft Access database and the Jet engine to retrieve the data.
sarrow.gifSee ''Using Tables," p. 570
Creating the MDI Form
The setup of the MDI form is the same as you have seen in previous sections. You first need to add an MDI form to your project and then set the AutoShowChildren property to False. You also should set the Name and Caption properties of the MDI form to something other than the defaults.
After setting the properties of the form, you need to create a menu that displays the customer information in the appropriate child form. The menu items that you need to add are shown in Figure 17.18.
sarrow.gifSee "Creating a Menu Bar," p. 108
0396-01.jpg
Figure 17.18
The sample MDI Contact Manager
application has these menu items.
One menu item of note is the Create New Form item. The user can use this option to tell the program whether to display a selected customer in the existing child form or to create a new form for each new customer. The Checked property of the item is set to show the status of the user choice.
Of course, after you create the menu, you need to add code to make the menu options work. Listing 17.2 shows the code for the menu items shown in Figure 17.18.

 
< previous page page_396 next page >